<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix ="c"%>
<%-- jstl 标签库  就是 将一些 java 代码用标签的形式 进行替换--%>
<!DOCTYPE html>
<html>
<head>
  <title>JSP - Hello World</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/list.css">
</head>
<body>
<div class="div-body">

    <div class="div-header">
        <h1>头部信息展示数据</h1>
    </div>
    <div class="div-center">

        <div class="div-center-left">
<%--            ${pageContext.request.contextPath} 获取当前项目名称 --%>
            <div><a href="${pageContext.request.contextPath}/user/list.jsp">用户管理</a></div>
        </div>
        <div class="div-center-right">
            <div class="div-center-right-box">
                <div style="display: flex;flex-direction: row;    justify-content: space-between;">

                    <form action="">
                        账号:<input type="text" name="username">
                        姓名:<input type="text" name="name">
                        <input type="submit" value="查询">
                    </form>

                    <div style="    margin-right: 50px;">
                        <a href="/book/user/addUser.jsp">添加用户</a>
                    </div>

                </div>

                <div>
                    <table border="1px solid ">
                        <tr>
                            <td>序号</td>
                            <td>账号</td>
                            <td>真实姓名</td>
                            <td>年龄</td>
                            <td>操作</td>
                        </tr>

                        <c:forEach items="${users}" var="u">
                            <tr>
                                <td>${u.id}</td>
                                <td>${u.userName}</td>
                                <td>${u.name}</td>
                                <td>${u.age}</td>
                                <td>
                                    <a href="/book/user/updateUser.jsp" target="_blank">修改</a>
                                    <a href="#">删除</a>
                                </td>
                            </tr>

                        </c:forEach>



                    </table>
                </div>

            </div>
        </div>
    </div>

    <div class="div-footer">
        <h1>底部信息</h1>
    </div>

</div>



</body>
</html>

